package com.example.fileserver_API.Controller.WorkBench;

import com.example.fileserver_API.Entity.Dto.PageParmar.PageParmar;
import com.example.fileserver_API.Entity.PO.sysappsettings;
import com.example.fileserver_API.Entity.VO.APIResult;
import com.example.fileserver_API.Interfaces.IService.WorkBench.ISysSettingService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@RestController
@RequestMapping("/API/SysSetting")
public class SysSettingController {

    @Resource
    ISysSettingService iSysSettingService;

    /**
     * 分页获取策略
     * @param pageParmar 分页
     * @return APIResult
     */
    @PostMapping("/GetSysSetting")
    public APIResult GetSysSetting(@RequestBody PageParmar pageParmar){
        return iSysSettingService.GetSysSetting(pageParmar);
    }

    /**
     * 添加一个策略
     * @param sysappsettings 策略内容
     * @return APIResult
     */
    @PostMapping("/AddSysSetting")
    public APIResult AddSysSetting(@RequestBody sysappsettings sysappsettings){
        return iSysSettingService.AddSysSetting(sysappsettings);
    }

    /**
     * 修改一个策略
     * @param sysappsettings 策略内容
     * @return APIResult
     */
    @PostMapping("/UpdateSysSetting")
    public APIResult UpdateSysSetting(@RequestBody sysappsettings sysappsettings){
        return iSysSettingService.UpdateSysSetting(sysappsettings);
    }

    /**
     * 删除策略
     * @param guid 策略编号
     * @return APIResult
     */
    @GetMapping("/DeleteSysSetting")
    public APIResult DeleteSysSetting(String guid){
        return iSysSettingService.DeleteSysSetting(guid);
    }
}
